Skip to content

fix: Write a JSON tombstone for deleted items in the DynamoDB store - #269

Draft
keelerm84 wants to merge 1 commit into
mainfrom
mk/SDK-3638/dynamodb-json-tombstone
Draft

keelerm84 wants to merge 1 commit into
mainfrom
mk/SDK-3638/dynamodb-json-tombstone

Conversation

@keelerm84

Copy link
Copy Markdown
Member

Summary

The DynamoDB store wrote the item attribute of a deleted flag or segment as the string "null". Other SDKs that read the same table fail on it: the Go SDK and the Relay Proxy fail the whole read of the kind, Python's all() raises, Ruby raises, and PHP's getAllFeatures throws a TypeError.

The store now writes the tombstone JSON that the SDK passes in, {"version":N,"deleted":true}, the same as the Redis and Consul stores. If the serialized item is null, it builds the same JSON from the data kind. It still reads a "null" item as deleted, so tables written by older versions keep working. New unit tests cover the stored tombstone on upsert and init, and the legacy placeholder through get and getAll.

The contract test service uses the published DynamoDB store, so the persistent data store/dynamodb/read-write/data source deletions respect versioning suppression stays until a release with this fix is out and the service's store version is bumped. Against a local build of this store, that test passes on the v2 and v3 harness.

Opened from termag

The DynamoDB store wrote the string "null" as the item of a deleted flag or
segment. SDKs in other languages and the Relay Proxy fail a whole bulk read
on that value. Store the SDK's serialized tombstone ({"version":N,"deleted":true})
instead, as the Redis and Consul stores do. The store still reads "null" as a
deleted item, so tables written by older versions keep working.

Remove the contract test suppression for DynamoDB data source deletions.

Generated-by: termag

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant